package com.jerry.lastgomall.order.web;

import com.jerry.lastgomall.order.entity.OrderEntity;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    @ResponseBody
    @GetMapping("/createOrderTest")
    public String createOrderTest(){
        OrderEntity orderEntity = new OrderEntity();
        orderEntity.setOrderId(1111111l);
        rabbitTemplate.convertAndSend("order-event-exchange","order.create.order",orderEntity);
        return "成功";
    }



}
